package com.qf;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.IOException;

public class Ground {
    public BufferedImage moveGround;
    public int x=0;
    public int y=500;
    public Ground(){
        try {
            //读取项目中图片,赋值给属性:image
            x=0;
            y=500;
            moveGround= ImageIO.read(getClass().getResource("image/ground.png"));
        } catch (IOException e) {
            System.out.println("图片不存在");
        }
    }
    public void step(){//地面移动方法
        //让地面沿x轴向左移动100像素,然后循环
        x--;
        if (x == -100){
            x=0;
        }
    }
}
